package com.example.springboot.demo1.SpringData.dao;

import com.example.springboot.demo1.SpringData.domain.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UserRepository extends JpaRepository<User,Long> {

    User findByName(String name);
    User findByNameAndSex(String name,String sex);
    @Query("from User u where u.name=:name")
    User findUser(@Param("name") String name);
}
